import request from '../../utils/Request'

export const saveArticle = data => {
    return request({
        method: 'post',
        url: '/api/cms/article/save',
        data: data
    })
}

export const selectArticle = ukId => {
    return request({
        method: 'get',
        url: '/api/cms/article/select/' + ukId,
        params: {}
    })
}

export const selectArticleDetails = ukId => {
    return request({
        method: 'get',
        url: '/api/cms/article/select/details/' + ukId,
        params: {}
    })
}

export const deleteArticle = bId => {
    return request({
        method: 'get',
        url: '/api/cms/article/delete/' + bId,
        params: {}
    })
}

export const listArticle = (data, current, size) => {
    data.current = current
    data.size = size
    return request({
        method: 'get',
        url: '/api/cms/article/list',
        params: data
    })
}

export const listArticleByCurrentUser = bid =>{
    return request({
        method: 'get',
        url: '/api/cms/article/list/user',
        params: {}
    })
}

export const updateArticleStatus = bid =>{
    return request({
        method: 'get',
        url: '/api/cms/article/update/status/' + bid,
        params: {}
    })
}